<style>
    table tr td {   
        border: none;
        width: 100px;
    }
    .badge {
    padding-top: 0px;
    -webkit-border-radius: 2px;
    -moz-border-radius: 1px;
    border-radius: 1px;
    }
</style>
<div id="editStory<?php echo $story['id'];?>" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
                    
    
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Editar User Story</h3>
        
    </div>
    <div class="modal-body">
        <?php
        
        //echo $this->Form->create('Story', array('url' => array('controller' => 'stories', 'action' => 'edit',$idStory), 'class'=>'form-horizontal'));
        ?> 
        <fieldset> 

        <?php 
        echo $this->Form->create('Story',array('url' => '../stories/edit/'.$story['id'].'/'.$from, 'class'=>'form-horizontal')); //array('url' => array('controller' => 'stories', 'action' => 'edit',$story['id']))
        
        $optionsLabel1 = array('class' => 'control-label','text'=>'Resumen');
        $options1 = array('value'=>$story['summary'],'div' => 'control-group','label'=>$optionsLabel1,'class'=>'controls');
        echo $this->Form->input('summary',$options1);

        $optionsLabel2 = array('class' => 'control-label','text'=>'Detalle');
        $options2 = array('value'=>$story['detail'],'div' => 'control-group','label'=>$optionsLabel2,'class'=>'controls','rows' => '3');
        echo $this->Form->input('detail',$options2);
        
        
        $optionsLabelS = array('class' => 'control-label','style'=>'padding-right:20px','text'=>'Sprint');

        //var_dump($story);
        $arrOptions=array();
                    for ($i=0;$i<$pSprints;$i++){
                        $idS=$i;
                        $nameS='Sprint '.($idS+1);
                        $arrOptions[$idS]=$nameS;
                
            }
        echo $this->Form->input('sprint', array(
            'options' => $arrOptions,'value' => $story['sprint'],'div' => 'control-group',/*'class'=>'chzn-select',*/
            'label'=>$optionsLabelS ));

       
        
//        echo $this->Form->input('summary',array('value'=>$story['summary']));
//        echo $this->Form->input('detail', array('rows' => '3','label' => 'Detalle','value'=>$story['detail']));
        echo $this->Form->input('id', array('type' => 'hidden','value'=>$story['id']));
        /*ESTIMACION*/
        //$optionsR = array('0' => '?', '1' => '1', '2' => '2', '3' => '3', '5' => '5', '8' => '8', '13' => '13', '20' => '20', '40' => '40', '100' => '100' , '1000' => 'Infinito');
        $optionsR = array('-1' => '?', '0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '5', '5' => '8' , '6' => 'Infinito');
        
            $attributesR = array('value'=>$story['points'],'legend'=>false,'separator' => '</td><td>'); ?>
            <div class="control-group">
            <label class="control-label">Estimación</label>    
            <table style="margin-left: 20px; display: inline-block;  margin-bottom: 0; width: 200px;">
                <tr>
                    <td>
                    <?php   
                       // if($story['points']==0)
                            echo $this->Form->radio('points', $optionsR, $attributesR);
//                        else
//                            echo $story['points'];
                    ?> 
                    </td>
                </tr>
            </table>
            </div>
       
            <?php 
            //RESPONSABLE
            $arrOptionsMember=array();
            for ($i=0;$i<count($members);$i++){
                $idM=$members[$i]['id'];
                $nameM=$members[$i]['username'];
                $arrOptionsMember[$idM]=$nameM;
            }
            ?>
           
            
            <?php 
            $optionsLabelRes = array('class' => 'control-label','style'=>'padding-right:20px','text'=>'Responsable');
            echo $this->Form->input('responsible_id', array(
                        'options' => $arrOptionsMember/*,'class'=>'chzn-select'*/,'div' => 'control-group',
                        'value'=>$story['responsible_id'],
                        'label' => $optionsLabelRes,
                        'empty' => '(choose one)'
                    ));?>
            
            
                 
        <?php    
        /*ESTADO!!*/   
        $options = array('0' => '<span class="badge badge-inverse">ToDo</span>', 
                        '1' => '<span class="badge badge-warning">Doing</span>',
                        '2' => '<span class="badge badge-info">Review</span>', 
                        '3' => '<span class="badge badge-success">Done</span>');
            $attributes = array('value'=>$story['state'],'legend'=>false,'scape'=>false,'separator' => '</div></td>    <td><div class="inline_labels">'); ?>
            <div class="control-group">
            <label class="control-label">Estado</label>
            <style>
                .inline_labels label{  display: inline-block;}

            </style>
            
            <table style="margin-left: 20px; display: inline-block;  margin-bottom: 0; width: 360px; padding-top: 5px">
                <tr>
                    <td>
                        <div class="inline_labels">
                    <?php   echo $this->Form->radio('state', $options, $attributes);
                    ?> 
                        </div>
                    </td>
                </tr>
            </table>
            </div>
            
            
        </fieldset>

    </div>
    <div class="modal-footer">
        <div class="row-fluid " >
            <div class="span12">
                <div class="span8">                      
                </div>
                <div class="span2">
                    <button class="btn" data-dismiss="modal">Cancelar</button>
                </div>
                <div class="span2">
                    <?php
                    $options = array(
                        'label' => 'Guardar','class' => 'btn'
                    );
                    echo $this->Form->end($options);
                    ?>
                </div>
            </div>
        </div>
    </div>
    
</div>
